Contents | Index | < Browse | Browse >
LETTERfseekULETTER
Sets a file's byte cursor to a new position.
Overview
#include <stdio.h>
r = fseek(f,offset,mode);
int r;
FILE *f;
long offset;
int mode;
Portability
ANSI
Description
This function moves the byte cursor of the file referred to by "f" to a new
position. "offset" is the offset relative to the seek position specified
by "mode".
Allowed values for "mode" are:
SEEK_CUR: The offset is based relative to the current position and can thus be
either positive or negative.
SEEK_SET: The offset is based relative to the start of the file and should thus
be positive.
SEEK_END: The offset is based relative to the end of the file and should thus
be negative.
Returns
If an error occured, zero is returned, otherwise a value unequal zero.